package com.javasm.mb_store_api_final.sys_control.logcontrol.controller;

import com.javasm.common.R;
import com.javasm.mb_store_api_final.sys_control.logcontrol.entity.SysLogInfo;
import com.javasm.mb_store_api_final.sys_control.logcontrol.entity.SysLoginLog;
import com.javasm.mb_store_api_final.sys_control.logcontrol.service.SysLoginLogService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Lx
 * @version 0.1
 * @className logController
 * @date 2024/8/4 16:54
 * @description
 * @since jdk11
 */
@RestController
@RequestMapping("/log")
public class logController {

    @Resource
    SysLoginLogService sysLoginLogService;

    @GetMapping("/query")
    public R queryAllLog(){
        List<SysLoginLog> log = sysLoginLogService.queryAllLog();
        return R.ok(log);
    }
    @GetMapping("/queryBy")
    public R queryBy(SysLogInfo sysLogInfo){
        List<SysLoginLog> log = sysLoginLogService.queryBy(sysLogInfo);
        return R.ok(log);
    }
}
